.class public Lcom/opongo/android/custom/PostsActivity;
.super Landroid/app/TabActivity;
.source "PostsActivity.java"


# static fields
#the value of this static final field might be set in the static constructor
.field public static final DEBUG:Z = false

.field public static final PREFS_NAME:Ljava/lang/String; = "BlogApp"

.field private static final TAG:Ljava/lang/String;


# instance fields
.field private editor:Landroid/content/SharedPreferences$Editor;

.field private last_post_id:I

.field private mTabHost:Landroid/widget/TabHost;

.field private post_id:I

.field private progressDialog:Landroid/app/ProgressDialog;

.field private receiver:Landroid/content/BroadcastReceiver;

.field private receiver2:Landroid/content/BroadcastReceiver;

.field private receiver3:Landroid/content/BroadcastReceiver;

.field private receiver4:Landroid/content/BroadcastReceiver;

.field private settings:Landroid/content/SharedPreferences;

.field private userId:I


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 44
    sget-boolean v0, Lcom/opongo/blogapp/AbaSettings;->DEBUG:Z

    sput-boolean v0, Lcom/opongo/android/custom/PostsActivity;->DEBUG:Z

    .line 45
    const-class v0, Lcom/opongo/android/custom/PostsActivity;

    invoke-virtual {v0}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String;

    move-result-object v0

    sput-object v0, Lcom/opongo/android/custom/PostsActivity;->TAG:Ljava/lang/String;

    .line 42
    return-void
.end method

.method public constructor <init>()V
    .locals 0

    .prologue
    .line 42
    invoke-direct {p0}, Landroid/app/TabActivity;-><init>()V

    return-void
.end method

.method static synthetic access$0(Lcom/opongo/android/custom/PostsActivity;)Landroid/app/ProgressDialog;
    .locals 1
    .parameter

    .prologue
    .line 284
    invoke-direct {p0}, Lcom/opongo/android/custom/PostsActivity;->getProgressDialog()Landroid/app/ProgressDialog;

    move-result-object v0

    return-object v0
.end method

.method static synthetic access$1()Ljava/lang/String;
    .locals 1

    .prologue
    .line 45
    sget-object v0, Lcom/opongo/android/custom/PostsActivity;->TAG:Ljava/lang/String;

    return-object v0
.end method

.method static synthetic access$2(Lcom/opongo/android/custom/PostsActivity;I)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 48
    iput p1, p0, Lcom/opongo/android/custom/PostsActivity;->userId:I

    return-void
.end method

.method static synthetic access$3(Lcom/opongo/android/custom/PostsActivity;)I
    .locals 1
    .parameter

    .prologue
    .line 48
    iget v0, p0, Lcom/opongo/android/custom/PostsActivity;->userId:I

    return v0
.end method

.method private cleanupCache()V
    .locals 9

    .prologue
    const/4 v5, 0x0

    .line 326
    sget-boolean v6, Lcom/opongo/android/custom/PostsActivity;->DEBUG:Z

    if-eqz v6, :cond_0

    sget-object v6, Lcom/opongo/android/custom/PostsActivity;->TAG:Ljava/lang/String;

    const-string v7, "About to cleanup cache..."

    invoke-static {v6, v7}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 328
    :cond_0
    new-instance v0, Lcom/opongo/blogapp/manager/DatabaseManager;

    invoke-direct {v0, p0}, Lcom/opongo/blogapp/manager/DatabaseManager;-><init>(Landroid/content/Context;)V

    .line 329
    .local v0, dbManager:Lcom/opongo/blogapp/manager/DatabaseManager;
    new-instance v1, Lcom/opongo/blogapp/utils/FileCache;

    invoke-direct {v1, p0}, Lcom/opongo/blogapp/utils/FileCache;-><init>(Landroid/content/Context;)V

    .line 330
    .local v1, imgCache:Lcom/opongo/blogapp/utils/FileCache;
    const/4 v6, 0x1

    new-array v4, v6, [Ljava/lang/String;

    const-string v6, "recent_posts"

    aput-object v6, v4, v5

    .line 337
    .local v4, tablesOrderByDate:[Ljava/lang/String;
    array-length v6, v4

    :goto_0
    if-lt v5, v6, :cond_1

    .line 359
    invoke-virtual {v0}, Lcom/opongo/blogapp/manager/DatabaseManager;->close()V

    .line 362
    const/4 v5, 0x3

    invoke-virtual {v1, v5}, Lcom/opongo/blogapp/utils/FileCache;->clear(I)I

    .line 363
    return-void

    .line 337
    :cond_1
    aget-object v3, v4, v5

    .line 338
    .local v3, table:Ljava/lang/String;
    new-instance v7, Ljava/lang/StringBuilder;

    const-string v8, "DELETE FROM "

    invoke-direct {v7, v8}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v7, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    const-string v8, " WHERE "

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    .line 339
    const-string v8, "_id"

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    const-string v8, " NOT IN (SELECT "

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    .line 340
    const-string v8, "_id"

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    const-string v8, " FROM "

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    invoke-virtual {v7, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    const-string v8, " ORDER BY "

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    .line 341
    const-string v8, "date"

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    const-string v8, " DESC LIMIT "

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    .line 342
    const/16 v8, 0x14

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v7

    const-string v8, ");"

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    .line 338
    invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    .line 344
    .local v2, query:Ljava/lang/String;
    invoke-virtual {v0, v2}, Lcom/opongo/blogapp/manager/DatabaseManager;->execQuery(Ljava/lang/String;)V

    .line 337
    add-int/lit8 v5, v5, 0x1

    goto :goto_0
.end method

.method private static createTabView(Landroid/content/Context;Ljava/lang/String;)Landroid/view/View;
    .locals 5
    .parameter "context"
    .parameter "text"

    .prologue
    .line 211
    invoke-static {p0}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v2

    const v3, 0x7f03001a

    const/4 v4, 0x0

    invoke-virtual {v2, v3, v4}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v1

    .line 212
    .local v1, view:Landroid/view/View;
    const v2, 0x7f080059

    invoke-virtual {v1, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/TextView;

    .line 213
    .local v0, tv:Landroid/widget/TextView;
    invoke-virtual {v0, p1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 214
    return-object v1
.end method

.method private getProgressDialog()Landroid/app/ProgressDialog;
    .locals 2

    .prologue
    .line 285
    iget-object v0, p0, Lcom/opongo/android/custom/PostsActivity;->progressDialog:Landroid/app/ProgressDialog;

    if-nez v0, :cond_0

    .line 286
    new-instance v0, Landroid/app/ProgressDialog;

    invoke-direct {v0, p0}, Landroid/app/ProgressDialog;-><init>(Landroid/content/Context;)V

    iput-object v0, p0, Lcom/opongo/android/custom/PostsActivity;->progressDialog:Landroid/app/ProgressDialog;

    .line 287
    iget-object v0, p0, Lcom/opongo/android/custom/PostsActivity;->progressDialog:Landroid/app/ProgressDialog;

    const v1, 0x7f070017

    invoke-virtual {p0, v1}, Lcom/opongo/android/custom/PostsActivity;->getString(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/app/ProgressDialog;->setMessage(Ljava/lang/CharSequence;)V

    .line 288
    iget-object v0, p0, Lcom/opongo/android/custom/PostsActivity;->progressDialog:Landroid/app/ProgressDialog;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Landroid/app/ProgressDialog;->setIndeterminate(Z)V

    .line 289
    iget-object v0, p0, Lcom/opongo/android/custom/PostsActivity;->progressDialog:Landroid/app/ProgressDialog;

    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Landroid/app/ProgressDialog;->setCancelable(Z)V

    .line 291
    :cond_0
    iget-object v0, p0, Lcom/opongo/android/custom/PostsActivity;->progressDialog:Landroid/app/ProgressDialog;

    return-object v0
.end method

.method private openPostByBroadcast(I)V
    .locals 3
    .parameter "p"

    .prologue
    .line 224
    iget v1, p0, Lcom/opongo/android/custom/PostsActivity;->last_post_id:I

    if-eq p1, v1, :cond_0

    .line 225
    iput p1, p0, Lcom/opongo/android/custom/PostsActivity;->last_post_id:I

    .line 226
    iget-object v1, p0, Lcom/opongo/android/custom/PostsActivity;->mTabHost:Landroid/widget/TabHost;

    const/4 v2, 0x0

    invoke-virtual {v1, v2}, Landroid/widget/TabHost;->setCurrentTab(I)V

    .line 227
    new-instance v0, Landroid/content/Intent;

    const-string v1, "com.opongo.post_open_by_push"

    invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 228
    .local v0, i:Landroid/content/Intent;
    const-string v1, "POST_ID"

    invoke-static {p1}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 229
    invoke-virtual {p0, v0}, Lcom/opongo/android/custom/PostsActivity;->sendBroadcast(Landroid/content/Intent;)V

    .line 231
    .end local v0           #i:Landroid/content/Intent;
    :cond_0
    return-void
.end method

.method private openSpicyDealByBroadcast(I)V
    .locals 3
    .parameter "p"

    .prologue
    .line 234
    iget v1, p0, Lcom/opongo/android/custom/PostsActivity;->last_post_id:I

    if-eq p1, v1, :cond_0

    .line 235
    iput p1, p0, Lcom/opongo/android/custom/PostsActivity;->last_post_id:I

    .line 236
    iget-object v1, p0, Lcom/opongo/android/custom/PostsActivity;->mTabHost:Landroid/widget/TabHost;

    const/4 v2, 0x1

    invoke-virtual {v1, v2}, Landroid/widget/TabHost;->setCurrentTab(I)V

    .line 237
    new-instance v0, Landroid/content/Intent;

    const-string v1, "com.opongo.post_open_by_spicyDeal"

    invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 238
    .local v0, i:Landroid/content/Intent;
    const-string v1, "POST_ID"

    invoke-static {p1}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 239
    invoke-virtual {p0, v0}, Lcom/opongo/android/custom/PostsActivity;->sendBroadcast(Landroid/content/Intent;)V

    .line 241
    .end local v0           #i:Landroid/content/Intent;
    :cond_0
    return-void
.end method

.method private setupTab(Landroid/view/View;Ljava/lang/String;Landroid/content/Intent;)V
    .locals 3
    .parameter "view"
    .parameter "tag"
    .parameter "intent"

    .prologue
    .line 203
    iget-object v2, p0, Lcom/opongo/android/custom/PostsActivity;->mTabHost:Landroid/widget/TabHost;

    invoke-virtual {v2}, Landroid/widget/TabHost;->getContext()Landroid/content/Context;

    move-result-object v2

    invoke-static {v2, p2}, Lcom/opongo/android/custom/PostsActivity;->createTabView(Landroid/content/Context;Ljava/lang/String;)Landroid/view/View;

    move-result-object v1

    .line 204
    .local v1, tabview:Landroid/view/View;
    iget-object v2, p0, Lcom/opongo/android/custom/PostsActivity;->mTabHost:Landroid/widget/TabHost;

    invoke-virtual {v2, p2}, Landroid/widget/TabHost;->newTabSpec(Ljava/lang/String;)Landroid/widget/TabHost$TabSpec;

    move-result-object v2

    invoke-virtual {v2, v1}, Landroid/widget/TabHost$TabSpec;->setIndicator(Landroid/view/View;)Landroid/widget/TabHost$TabSpec;

    move-result-object v2

    .line 205
    invoke-virtual {v2, p3}, Landroid/widget/TabHost$TabSpec;->setContent(Landroid/content/Intent;)Landroid/widget/TabHost$TabSpec;

    move-result-object v0

    .line 206
    .local v0, setContent:Landroid/widget/TabHost$TabSpec;
    iget-object v2, p0, Lcom/opongo/android/custom/PostsActivity;->mTabHost:Landroid/widget/TabHost;

    invoke-virtual {v2, v0}, Landroid/widget/TabHost;->addTab(Landroid/widget/TabHost$TabSpec;)V

    .line 207
    return-void
.end method


# virtual methods
.method public onCreate(Landroid/os/Bundle;)V
    .locals 8
    .parameter "savedInstanceState"

    .prologue
    const/4 v7, 0x1

    const/4 v6, 0x0

    .line 67
    invoke-super {p0, p1}, Landroid/app/TabActivity;->onCreate(Landroid/os/Bundle;)V

    .line 68
    const v2, 0x7f030019

    invoke-virtual {p0, v2}, Lcom/opongo/android/custom/PostsActivity;->setContentView(I)V

    .line 71
    const-string v2, "BlogApp"

    invoke-virtual {p0, v2, v6}, Lcom/opongo/android/custom/PostsActivity;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object v2

    iput-object v2, p0, Lcom/opongo/android/custom/PostsActivity;->settings:Landroid/content/SharedPreferences;

    .line 72
    iget-object v2, p0, Lcom/opongo/android/custom/PostsActivity;->settings:Landroid/content/SharedPreferences;

    invoke-interface {v2}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v2

    iput-object v2, p0, Lcom/opongo/android/custom/PostsActivity;->editor:Landroid/content/SharedPreferences$Editor;

    .line 74
    sget-boolean v2, Lcom/opongo/android/custom/PostsActivity;->DEBUG:Z

    if-eqz v2, :cond_0

    .line 75
    sget-object v2, Lcom/opongo/android/custom/PostsActivity;->TAG:Ljava/lang/String;

    const-string v3, "*** create ***"

    invoke-static {v2, v3}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 77
    :cond_0
    invoke-direct {p0}, Lcom/opongo/android/custom/PostsActivity;->cleanupCache()V

    .line 79
    sget v2, Landroid/os/Build$VERSION;->SDK_INT:I

    const/4 v3, 0x7

    if-le v2, v3, :cond_1

    .line 80
    const v2, 0x7f070005

    invoke-virtual {p0, v2}, Lcom/opongo/android/custom/PostsActivity;->getString(I)Ljava/lang/String;

    move-result-object v2

    invoke-static {p0, v2}, Lcom/google/android/c2dm/C2DMessaging;->register(Landroid/content/Context;Ljava/lang/String;)V

    .line 82
    :cond_1
    const v2, 0x1020012

    invoke-virtual {p0, v2}, Lcom/opongo/android/custom/PostsActivity;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/TabHost;

    iput-object v2, p0, Lcom/opongo/android/custom/PostsActivity;->mTabHost:Landroid/widget/TabHost;

    .line 86
    const/high16 v2, 0x40c0

    invoke-virtual {p0}, Lcom/opongo/android/custom/PostsActivity;->getResources()Landroid/content/res/Resources;

    move-result-object v3

    invoke-virtual {v3}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;

    move-result-object v3

    .line 85
    invoke-static {v7, v2, v3}, Landroid/util/TypedValue;->applyDimension(IFLandroid/util/DisplayMetrics;)F

    move-result v2

    float-to-int v1, v2

    .line 88
    .local v1, p:I
    iget-object v2, p0, Lcom/opongo/android/custom/PostsActivity;->mTabHost:Landroid/widget/TabHost;

    invoke-virtual {v2}, Landroid/widget/TabHost;->getTabWidget()Landroid/widget/TabWidget;

    move-result-object v2

    invoke-virtual {v2, v1, v1, v1, v1}, Landroid/widget/TabWidget;->setPadding(IIII)V

    .line 90
    new-instance v2, Landroid/widget/TextView;

    invoke-direct {v2, p0}, Landroid/widget/TextView;-><init>(Landroid/content/Context;)V

    const v3, 0x7f07000f

    invoke-virtual {p0, v3}, Lcom/opongo/android/custom/PostsActivity;->getString(I)Ljava/lang/String;

    move-result-object v3

    .line 91
    new-instance v4, Landroid/content/Intent;

    invoke-direct {v4}, Landroid/content/Intent;-><init>()V

    const-class v5, Lcom/opongo/android/custom/DealsActivity;

    invoke-virtual {v4, p0, v5}, Landroid/content/Intent;->setClass(Landroid/content/Context;Ljava/lang/Class;)Landroid/content/Intent;

    move-result-object v4

    .line 90
    invoke-direct {p0, v2, v3, v4}, Lcom/opongo/android/custom/PostsActivity;->setupTab(Landroid/view/View;Ljava/lang/String;Landroid/content/Intent;)V

    .line 93
    new-instance v2, Landroid/widget/TextView;

    invoke-direct {v2, p0}, Landroid/widget/TextView;-><init>(Landroid/content/Context;)V

    const v3, 0x7f07004d

    invoke-virtual {p0, v3}, Lcom/opongo/android/custom/PostsActivity;->getString(I)Ljava/lang/String;

    move-result-object v3

    .line 94
    new-instance v4, Landroid/content/Intent;

    invoke-direct {v4}, Landroid/content/Intent;-><init>()V

    const-class v5, Lcom/opongo/android/custom/SpicyDealsActivity;

    invoke-virtual {v4, p0, v5}, Landroid/content/Intent;->setClass(Landroid/content/Context;Ljava/lang/Class;)Landroid/content/Intent;

    move-result-object v4

    .line 93
    invoke-direct {p0, v2, v3, v4}, Lcom/opongo/android/custom/PostsActivity;->setupTab(Landroid/view/View;Ljava/lang/String;Landroid/content/Intent;)V

    .line 96
    new-instance v2, Landroid/widget/TextView;

    invoke-direct {v2, p0}, Landroid/widget/TextView;-><init>(Landroid/content/Context;)V

    const v3, 0x7f070011

    invoke-virtual {p0, v3}, Lcom/opongo/android/custom/PostsActivity;->getString(I)Ljava/lang/String;

    move-result-object v3

    .line 97
    new-instance v4, Landroid/content/Intent;

    invoke-direct {v4}, Landroid/content/Intent;-><init>()V

    const-class v5, Lcom/opongo/blogapp/activities/ShoutBoxActivity;

    invoke-virtual {v4, p0, v5}, Landroid/content/Intent;->setClass(Landroid/content/Context;Ljava/lang/Class;)Landroid/content/Intent;

    move-result-object v4

    .line 96
    invoke-direct {p0, v2, v3, v4}, Lcom/opongo/android/custom/PostsActivity;->setupTab(Landroid/view/View;Ljava/lang/String;Landroid/content/Intent;)V

    .line 102
    invoke-virtual {p0}, Lcom/opongo/android/custom/PostsActivity;->getIntent()Landroid/content/Intent;

    move-result-object v2

    invoke-virtual {v2}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;

    move-result-object v0

    .line 105
    .local v0, extras:Landroid/os/Bundle;
    if-eqz v0, :cond_3

    .line 107
    const-string v2, "POST_ID"

    invoke-virtual {v0, v2}, Landroid/os/Bundle;->containsKey(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_2

    .line 108
    const-string v2, "POST_ID"

    invoke-virtual {v0, v2}, Landroid/os/Bundle;->getInt(Ljava/lang/String;)I

    move-result v2

    iput v2, p0, Lcom/opongo/android/custom/PostsActivity;->post_id:I

    .line 109
    iget v2, p0, Lcom/opongo/android/custom/PostsActivity;->post_id:I

    invoke-direct {p0, v2}, Lcom/opongo/android/custom/PostsActivity;->openPostByBroadcast(I)V

    .line 111
    :cond_2
    const-string v2, "DEAL_ID"

    invoke-virtual {v0, v2}, Landroid/os/Bundle;->containsKey(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_3

    .line 112
    const-string v2, "DEAL_ID"

    invoke-virtual {v0, v2}, Landroid/os/Bundle;->getInt(Ljava/lang/String;)I

    move-result v2

    iput v2, p0, Lcom/opongo/android/custom/PostsActivity;->post_id:I

    .line 113
    iget v2, p0, Lcom/opongo/android/custom/PostsActivity;->post_id:I

    invoke-direct {p0, v2}, Lcom/opongo/android/custom/PostsActivity;->openSpicyDealByBroadcast(I)V

    .line 117
    :cond_3
    new-instance v2, Landroid/app/ProgressDialog;

    invoke-direct {v2, p0}, Landroid/app/ProgressDialog;-><init>(Landroid/content/Context;)V

    iput-object v2, p0, Lcom/opongo/android/custom/PostsActivity;->progressDialog:Landroid/app/ProgressDialog;

    .line 118
    iget-object v2, p0, Lcom/opongo/android/custom/PostsActivity;->progressDialog:Landroid/app/ProgressDialog;

    const v3, 0x7f070017

    invoke-virtual {p0, v3}, Lcom/opongo/android/custom/PostsActivity;->getString(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/app/ProgressDialog;->setMessage(Ljava/lang/CharSequence;)V

    .line 119
    iget-object v2, p0, Lcom/opongo/android/custom/PostsActivity;->progressDialog:Landroid/app/ProgressDialog;

    invoke-virtual {v2, v6}, Landroid/app/ProgressDialog;->setIndeterminate(Z)V

    .line 120
    iget-object v2, p0, Lcom/opongo/android/custom/PostsActivity;->progressDialog:Landroid/app/ProgressDialog;

    invoke-virtual {v2, v7}, Landroid/app/ProgressDialog;->setCancelable(Z)V

    .line 122
    new-instance v2, Lcom/opongo/android/custom/PostsActivity$1;

    invoke-direct {v2, p0}, Lcom/opongo/android/custom/PostsActivity$1;-><init>(Lcom/opongo/android/custom/PostsActivity;)V

    iput-object v2, p0, Lcom/opongo/android/custom/PostsActivity;->receiver:Landroid/content/BroadcastReceiver;

    .line 130
    iget-object v2, p0, Lcom/opongo/android/custom/PostsActivity;->receiver:Landroid/content/BroadcastReceiver;

    new-instance v3, Landroid/content/IntentFilter;

    .line 131
    const-string v4, "com.opongo.progressDialog_show"

    invoke-direct {v3, v4}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V

    .line 130
    invoke-virtual {p0, v2, v3}, Lcom/opongo/android/custom/PostsActivity;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;

    .line 133
    new-instance v2, Lcom/opongo/android/custom/PostsActivity$2;

    invoke-direct {v2, p0}, Lcom/opongo/android/custom/PostsActivity$2;-><init>(Lcom/opongo/android/custom/PostsActivity;)V

    iput-object v2, p0, Lcom/opongo/android/custom/PostsActivity;->receiver2:Landroid/content/BroadcastReceiver;

    .line 141
    iget-object v2, p0, Lcom/opongo/android/custom/PostsActivity;->receiver2:Landroid/content/BroadcastReceiver;

    new-instance v3, Landroid/content/IntentFilter;

    .line 142
    const-string v4, "com.opongo.progressDialog_hide"

    invoke-direct {v3, v4}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V

    .line 141
    invoke-virtual {p0, v2, v3}, Lcom/opongo/android/custom/PostsActivity;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;

    .line 144
    new-instance v2, Lcom/opongo/android/custom/PostsActivity$3;

    invoke-direct {v2, p0}, Lcom/opongo/android/custom/PostsActivity$3;-><init>(Lcom/opongo/android/custom/PostsActivity;)V

    iput-object v2, p0, Lcom/opongo/android/custom/PostsActivity;->receiver3:Landroid/content/BroadcastReceiver;

    .line 163
    iget-object v2, p0, Lcom/opongo/android/custom/PostsActivity;->receiver3:Landroid/content/BroadcastReceiver;

    new-instance v3, Landroid/content/IntentFilter;

    .line 164
    const-string v4, "com.opongo.post_open_comment"

    invoke-direct {v3, v4}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V

    .line 163
    invoke-virtual {p0, v2, v3}, Lcom/opongo/android/custom/PostsActivity;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;

    .line 166
    new-instance v2, Lcom/opongo/android/custom/PostsActivity$4;

    invoke-direct {v2, p0}, Lcom/opongo/android/custom/PostsActivity$4;-><init>(Lcom/opongo/android/custom/PostsActivity;)V

    iput-object v2, p0, Lcom/opongo/android/custom/PostsActivity;->receiver4:Landroid/content/BroadcastReceiver;

    .line 175
    iget-object v2, p0, Lcom/opongo/android/custom/PostsActivity;->receiver4:Landroid/content/BroadcastReceiver;

    new-instance v3, Landroid/content/IntentFilter;

    .line 176
    const-string v4, "com.opongo.noInternet"

    invoke-direct {v3, v4}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V

    .line 175
    invoke-virtual {p0, v2, v3}, Lcom/opongo/android/custom/PostsActivity;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;

    .line 179
    return-void
.end method

.method public onCreateOptionsMenu(Landroid/view/Menu;)Z
    .locals 2
    .parameter "menu"

    .prologue
    .line 296
    invoke-virtual {p0}, Lcom/opongo/android/custom/PostsActivity;->getMenuInflater()Landroid/view/MenuInflater;

    move-result-object v0

    const v1, 0x7f0e0005

    invoke-virtual {v0, v1, p1}, Landroid/view/MenuInflater;->inflate(ILandroid/view/Menu;)V

    .line 297
    invoke-super {p0, p1}, Landroid/app/TabActivity;->onCreateOptionsMenu(Landroid/view/Menu;)Z

    move-result v0

    return v0
.end method

.method protected onDestroy()V
    .locals 1

    .prologue
    .line 312
    iget-object v0, p0, Lcom/opongo/android/custom/PostsActivity;->progressDialog:Landroid/app/ProgressDialog;

    invoke-virtual {v0}, Landroid/app/ProgressDialog;->dismiss()V

    .line 313
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/opongo/android/custom/PostsActivity;->progressDialog:Landroid/app/ProgressDialog;

    .line 314
    iget-object v0, p0, Lcom/opongo/android/custom/PostsActivity;->receiver:Landroid/content/BroadcastReceiver;

    invoke-virtual {p0, v0}, Lcom/opongo/android/custom/PostsActivity;->unregisterReceiver(Landroid/content/BroadcastReceiver;)V

    .line 315
    iget-object v0, p0, Lcom/opongo/android/custom/PostsActivity;->receiver2:Landroid/content/BroadcastReceiver;

    invoke-virtual {p0, v0}, Lcom/opongo/android/custom/PostsActivity;->unregisterReceiver(Landroid/content/BroadcastReceiver;)V

    .line 316
    iget-object v0, p0, Lcom/opongo/android/custom/PostsActivity;->receiver3:Landroid/content/BroadcastReceiver;

    invoke-virtual {p0, v0}, Lcom/opongo/android/custom/PostsActivity;->unregisterReceiver(Landroid/content/BroadcastReceiver;)V

    .line 317
    iget-object v0, p0, Lcom/opongo/android/custom/PostsActivity;->receiver4:Landroid/content/BroadcastReceiver;

    invoke-virtual {p0, v0}, Lcom/opongo/android/custom/PostsActivity;->unregisterReceiver(Landroid/content/BroadcastReceiver;)V

    .line 318
    invoke-super {p0}, Landroid/app/TabActivity;->onDestroy()V

    .line 319
    return-void
.end method

.method public onNewIntent(Landroid/content/Intent;)V
    .locals 2
    .parameter "intent"

    .prologue
    .line 184
    invoke-virtual {p1}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;

    move-result-object v0

    .line 187
    .local v0, extras:Landroid/os/Bundle;
    if-eqz v0, :cond_1

    .line 189
    const-string v1, "POST_ID"

    invoke-virtual {v0, v1}, Landroid/os/Bundle;->containsKey(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_0

    .line 190
    const-string v1, "POST_ID"

    invoke-virtual {v0, v1}, Landroid/os/Bundle;->getInt(Ljava/lang/String;)I

    move-result v1

    iput v1, p0, Lcom/opongo/android/custom/PostsActivity;->post_id:I

    .line 191
    iget v1, p0, Lcom/opongo/android/custom/PostsActivity;->post_id:I

    invoke-direct {p0, v1}, Lcom/opongo/android/custom/PostsActivity;->openPostByBroadcast(I)V

    .line 193
    :cond_0
    const-string v1, "DEAL_ID"

    invoke-virtual {v0, v1}, Landroid/os/Bundle;->containsKey(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_1

    .line 194
    const-string v1, "DEAL_ID"

    invoke-virtual {v0, v1}, Landroid/os/Bundle;->getInt(Ljava/lang/String;)I

    move-result v1

    iput v1, p0, Lcom/opongo/android/custom/PostsActivity;->post_id:I

    .line 195
    iget v1, p0, Lcom/opongo/android/custom/PostsActivity;->post_id:I

    invoke-direct {p0, v1}, Lcom/opongo/android/custom/PostsActivity;->openSpicyDealByBroadcast(I)V

    .line 199
    :cond_1
    invoke-super {p0, p1}, Landroid/app/TabActivity;->onNewIntent(Landroid/content/Intent;)V

    .line 200
    return-void
.end method

.method public onOptionsItemSelected(Landroid/view/MenuItem;)Z
    .locals 1
    .parameter "item"

    .prologue
    .line 301
    invoke-interface {p1}, Landroid/view/MenuItem;->getItemId()I

    move-result v0

    packed-switch v0, :pswitch_data_0

    .line 306
    const/4 v0, 0x0

    :goto_0
    return v0

    .line 303
    :pswitch_0
    invoke-virtual {p0}, Lcom/opongo/android/custom/PostsActivity;->onSearchRequested()Z

    .line 304
    const/4 v0, 0x1

    goto :goto_0

    .line 301
    :pswitch_data_0
    .packed-switch 0x7f080068
        :pswitch_0
    .end packed-switch
.end method

.method public onSearchRequested()Z
    .locals 2

    .prologue
    const/4 v1, 0x0

    const/4 v0, 0x0

    .line 219
    invoke-virtual {p0, v1, v0, v1, v0}, Lcom/opongo/android/custom/PostsActivity;->startSearch(Ljava/lang/String;ZLandroid/os/Bundle;Z)V

    .line 220
    const/4 v0, 0x1

    return v0
.end method

.method public onStart()V
    .locals 9

    .prologue
    .line 245
    sget-boolean v5, Lcom/opongo/android/custom/PostsActivity;->DEBUG:Z

    if-eqz v5, :cond_0

    .line 246
    sget-object v5, Lcom/opongo/android/custom/PostsActivity;->TAG:Ljava/lang/String;

    const-string v6, "StartMain"

    invoke-static {v5, v6}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 248
    :cond_0
    iget-object v5, p0, Lcom/opongo/android/custom/PostsActivity;->settings:Landroid/content/SharedPreferences;

    const-string v6, "last_registerUser"

    const-wide/16 v7, 0x0

    invoke-interface {v5, v6, v7, v8}, Landroid/content/SharedPreferences;->getLong(Ljava/lang/String;J)J

    move-result-wide v1

    .line 249
    .local v1, last_registerUser:J
    new-instance v5, Ljava/util/Date;

    invoke-direct {v5}, Ljava/util/Date;-><init>()V

    invoke-virtual {v5}, Ljava/util/Date;->getTime()J

    move-result-wide v3

    .line 251
    .local v3, now:J
    const-wide/32 v5, 0x2932e00

    sub-long v5, v3, v5

    cmp-long v5, v1, v5

    if-gez v5, :cond_1

    .line 252
    iget-object v5, p0, Lcom/opongo/android/custom/PostsActivity;->editor:Landroid/content/SharedPreferences$Editor;

    const-string v6, "last_registerUser"

    invoke-interface {v5, v6, v3, v4}, Landroid/content/SharedPreferences$Editor;->putLong(Ljava/lang/String;J)Landroid/content/SharedPreferences$Editor;

    .line 253
    iget-object v5, p0, Lcom/opongo/android/custom/PostsActivity;->editor:Landroid/content/SharedPreferences$Editor;

    invoke-interface {v5}, Landroid/content/SharedPreferences$Editor;->commit()Z

    .line 255
    new-instance v0, Lcom/opongo/blogapp/manager/APIManager;

    invoke-direct {v0, p0}, Lcom/opongo/blogapp/manager/APIManager;-><init>(Landroid/content/Context;)V

    .line 261
    .local v0, apiManager:Lcom/opongo/blogapp/manager/APIManager;
    new-instance v5, Ljava/lang/Thread;

    new-instance v6, Lcom/opongo/android/custom/PostsActivity$5;

    invoke-direct {v6, p0, v0}, Lcom/opongo/android/custom/PostsActivity$5;-><init>(Lcom/opongo/android/custom/PostsActivity;Lcom/opongo/blogapp/manager/APIManager;)V

    invoke-direct {v5, v6}, Ljava/lang/Thread;-><init>(Ljava/lang/Runnable;)V

    .line 275
    invoke-virtual {v5}, Ljava/lang/Thread;->start()V

    .line 278
    .end local v0           #apiManager:Lcom/opongo/blogapp/manager/APIManager;
    :cond_1
    invoke-super {p0}, Landroid/app/TabActivity;->onStart()V

    .line 279
    return-void
.end method
